import java.io.DataInputStream;
import java.io.IOException;

import javax.microedition.io.StreamConnection;


public class SimpleServerDialer extends ConnectionDialer {
	private StreamConnection connection;
	private DataInputStream in;
	


	public void close() {
		try {
			connection.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

	public Message deal(StreamConnection conn) {
		connection = conn;
		try {
			in = connection.openDataInputStream();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		Message m = null;
		try {
			m = new Message(in.readUTF());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return m;
	}

}
